.model FLAT, C
.code
	AsmVmwareCall PROC _out:DWORD, cmd:WORD, param1:WORD, param2:DWORD
		push eax
		push ebx
		push ecx
		push edx

		mov ecx, dword ptr [cmd]
		mov eax, dword ptr [param1]
		shl eax, 16
		or ecx, eax

		mov ebx, [param2]
		mov eax, 0564D5868h	; VMXh
		mov dx,  05658h		; VX
		in eax, dx
		mov [_out + 00h], eax
		mov [_out + 04h], ebx
		mov [_out + 08h], ecx
		mov [_out + 0ch], edx

		pop edx
		pop ecx
		pop ebx
		pop eax
		ret
	AsmVmwareCall ENDP
end